def retainBus(route):
    if route['route_type'] == '3':
        return True
    else:
        return False

def stopMap(stop):
    # Remove rail routes and stops
    stop['routes'] = filter(retainBus, stop['routes'])
    if len(stop['routes']) == 0:
        print 'removing rail stop %s (%s)' % (stop['stop_name'], stop['stop_id'])
        return None

    return stop
